package com.partyjoin.project.module.activistEvolve.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.partyjoin.common.utils.StringUtils;
import com.partyjoin.project.module.activistEvolve.mapper.ActivistEvolveMapper;
import com.partyjoin.project.module.activistEvolve.domain.ActivistEvolve;
import com.partyjoin.project.module.activistEvolve.service.IActivistEvolveService;
import com.partyjoin.common.support.Convert;

/**
 * 发展积极分子记录 服务层实现
 * 
 * @author 莫东林
 * @date 2018-07-19
 */
@Service
public class ActivistEvolveServiceImpl implements IActivistEvolveService 
{
	@Autowired
	private ActivistEvolveMapper activistEvolveMapper;

	/**
     * 查询发展积极分子记录信息
     * 
     * @param activistEvolveId 发展积极分子记录ID
     * @return 发展积极分子记录信息
     */
    @Override
	public ActivistEvolve selectActivistEvolveById(Integer activistEvolveId)
	{
	    return activistEvolveMapper.selectActivistEvolveById(activistEvolveId);
	}
	
	/**
     * 查询发展积极分子记录列表
     * 
     * @param activistEvolve 发展积极分子记录信息
     * @return 发展积极分子记录集合
     */
	@Override
	public List<ActivistEvolve> selectActivistEvolveList(ActivistEvolve activistEvolve)
	{
	    return activistEvolveMapper.selectActivistEvolveList(activistEvolve);
	}
	
    /**
     * 新增发展积极分子记录
     * 
     * @param activistEvolve 发展积极分子记录信息
     * @return 结果
     */
	@Override
	public int insertActivistEvolve(ActivistEvolve activistEvolve)
	{
	    return activistEvolveMapper.insertActivistEvolve(activistEvolve);
	}
	
	/**
     * 修改发展积极分子记录
     * 
     * @param activistEvolve 发展积极分子记录信息
     * @return 结果
     */
	@Override
	public int updateActivistEvolve(ActivistEvolve activistEvolve)
	{
	    return activistEvolveMapper.updateActivistEvolve(activistEvolve);
	}
	
	/**
     * 保存发展积极分子记录
     * 
     * @param activistEvolve 发展积极分子记录信息
     * @return 结果
     */
	@Override
	public int saveActivistEvolve(ActivistEvolve activistEvolve)
	{
	    Integer activistEvolveId = activistEvolve.getActivistEvolveId();
		int rows = 0;
		if (StringUtils.isNotNull(activistEvolveId))
        {
		    rows = activistEvolveMapper.updateActivistEvolve(activistEvolve);
		}
		else
        {
		    rows = activistEvolveMapper.insertActivistEvolve(activistEvolve);
		}
		return rows;
	}
	
	/**
     * 删除发展积极分子记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteActivistEvolveByIds(String ids)
	{
		return activistEvolveMapper.deleteActivistEvolveByIds(Convert.toStrArray(ids));
	}
	
}
